home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / serial / statseri.000 / statseri / statserial-1.1 / phone_log < prev    next >
Text File  |  1994-12-14  |  462b  |  19 lines

  1. #!/bin/bash
  2. #
  3. # This script uses statserial to check the Ring Indicator signal of a
  4. # modem. If the phone rings, it displays a message.
  5. #
  6. while true
  7. do
  8.   let ringing="`statserial -d /dev/modem` & 128"
  9.   if [ $ringing != 0 ]
  10.   then
  11.     # can either send message to standard out
  12.     echo -e "\a(`date`) Incoming Telephone Call"
  13.     # or send mail
  14.     # echo "Incoming phone call detected." | mail -s "Incoming Phone Call" `whoami`
  15.     sleep 10
  16.   fi
  17.   sleep 1
  18. done
  19.